package model;

import java.io.File;

public class Currency {

	private String currencyName;
	private String currencyAbreviation;
	private double rate;
	private String iconPath;

	public Currency(String currencyName, String currencyAbreviation,
			double rate, String iconPath) {
		this.currencyName = currencyName;
		this.currencyAbreviation = currencyAbreviation;
		this.rate = rate;
	    this.iconPath = (iconPath == null)? "img/empty.gif" : iconPath;
        File f = new File(this.iconPath);
        this.iconPath = (f.exists())? this.iconPath : "img/empty.gif";
	}

	public String getIconPath() {
		return this.iconPath;
	}

	public void setIcon(String iconPath) {
		this.iconPath = iconPath;
	}

	public String getCurrencyName() {
		return currencyName;
	}

	public void setCurrencyName(String currencyName) {
		this.currencyName = currencyName;
	}

	public String getCurrencyAbreviation() {
		return currencyAbreviation;
	}

	public void setCurrencyAbreviation(String currencyAbreviation) {
		this.currencyAbreviation = currencyAbreviation;
	}

	public double getRate() {
		return rate;
	}

	public void setRate(double rate) {
		this.rate = rate;
	}

}
